﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using LayuiDemo.Models;


namespace LayuiDemo.tms.ViewModels.DriverTruckVMs
{
    public partial class DriverTruckVM : BaseCRUDVM<DriverTruck>
    {
        public List<ComboSelectListItem> AllDrivers { get; set; }
        public List<ComboSelectListItem> AllTrucks { get; set; }

        public DriverTruckVM()
        {
            SetInclude(x => x.Driver);
            SetInclude(x => x.Truck);
        }

        protected override void InitVM()
        {
            AllDrivers = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
            AllTrucks = DC.Set<Truck>().GetSelectListItems(Wtm, y => y.TruckName);
        }

        public override void DoAdd()
        {           
            base.DoAdd();
        }

        public override void DoEdit(bool updateAllFields = false)
        {
            base.DoEdit(updateAllFields);
        }

        public override void DoDelete()
        {
            base.DoDelete();
        }
    }
}
